package com.ykh.spring;

import com.ykh.spring.controller.Controller;
import com.ykh.spring.dao.UserDao;
import com.ykh.spring.service.UserService;
import javafx.application.Application;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-08-23
 * Time: 15:11
 */
public class test {

    @Test
    public void test01() {
        ApplicationContext ioc = new ClassPathXmlApplicationContext("spring-annotation.xml");
        Controller controller = ioc.getBean(Controller.class);
//        System.out.println(controller);
//        UserService userService = ioc.getBean(UserService.class);
//        System.out.println(userService);
//        UserDao userDao = ioc.getBean(UserDao.class);
//        System.out.println(userDao);
        controller.saveUser();

    }
}
